
from .gitlabConnController import gitlalConn


class getListProjects():
    def allProjectLists():
        listProjects = gitlalConn.gl.projects.list()
        # print(listProjects)
        listAllProjects = []
        for listProject in listProjects:

            # listAllProjects.update(projectJson)

            if listProject.id == 1:
                continue

            projectJson = {"name_with_namespace": listProject.path_with_namespace, "projectId": listProject.id,
                           "owner": listProject.namespace["name"], "created_at": listProject.created_at, "http_url_to_repo":listProject.http_url_to_repo}
            listAllProjects.append(projectJson)

        return listAllProjects
